package com.qxzn.module.mine.activity;

import android.os.Bundle;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.qxzn.app.api.api.HttpRequest;
import com.qxzn.app.bean.FamilyMemberBean;
import com.qxzn.app.page.BaseActivity;
import com.qxzn.app.page.view.CustomItemView;
import com.qxzn.app.util.AppUtil;
import com.qxzn.module.mine.R;
import com.qxzn.module.mine.R2;

import butterknife.BindView;

/**
 * 家庭成员信息
 */
public class ShowMemberInfoActivity extends BaseActivity {
    @BindView(R2.id.civ_head)
    CustomItemView civHead;
    @BindView(R2.id.civ_nickname)
    CustomItemView civNickname;
    @BindView(R2.id.civ_phone)
    CustomItemView civPhone;
    private FamilyMemberBean.MemberBean memberBean;

    @Override
    protected int initLayout() {
        return R.layout.activity_show_member_info;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void iniTitleBar() {

    }

    @Override
    protected void initData(Bundle savedInstanceState) {
        memberBean = (FamilyMemberBean.MemberBean) getIntent().getSerializableExtra("member_bean");
        if (memberBean == null) {
            AppUtil.showToast(this, "数据有误");
            finish();
            return;
        }
        tv_title.setText(memberBean.getNiname());
        Glide.with(this).load(HttpRequest.BASE_URL + memberBean.getHeadportrait()).apply(RequestOptions.circleCropTransform().placeholder(R.mipmap.icon_xiaopai).error(R.mipmap.icon_xiaopai)).into(civHead.getIvRightIcon());
        civNickname.setRightText(memberBean.getNiname());
        civPhone.setRightText(memberBean.getUsername());
    }

}
